package com.gopay.common.domain.deposit;

import com.gopay.common.domain.BaseEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 保证金信息表
 *
 * @DepositInfo.java
 * @author tianxin
 * @2013-4-12 下午04:02:22 www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "CORP_DEPOSIT_INFO")
public class CorpDepositInfo extends BaseEntity{

    private static final long serialVersionUID = -7220795119626329694L;

    /**
     * 记录流水号
     */
    @Id
    @Column(name = "SQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CORP_DEPOSIT_INFO_SEQ")
    @SequenceGenerator(name = "CORP_DEPOSIT_INFO_SEQ", allocationSize = 1, initialValue = 1, sequenceName = "CORP_DEPOSIT_INFO_SEQ")
    private long sq;

    /**
     * 申请时间
     */
    @Column(name = "APPLY_TIME")
    private Date applyTime;

    /**
     * 客户id
     */
    @Column(name = "CUST_ID")
    private String custId;

    /**
     * 关联保证金账户的普通账户
     */
    @Column(name = "GNST_ACCT")
    private String gnstAcct;

    /**
     * 保证金账户
     */
    @Column(name = "DEPOSIT_ACCT")
    private String depositAcct;

    /**
     * 保证金权限开通标识 0：开通 1：关闭
     */
    @Column(name = "DEPOSIT_FLAG")
    private String depositFlag;

    /**
     * 需缴纳保证金金额
     */
    @Column(name = "PENDING_AMT")
    private BigDecimal pendingAmt;

    /**
     * 已缴纳保证金金额
     */
    @Column(name = "ALREADY_AMT")
    private BigDecimal alreadyAmt;

    /**
     * 关联保证金账户的普通账户锁定来源
     * 00-正常无锁定 01-人工付款锁定 02-反诈骗锁定 03-保证金付款锁定 04-人工+保证金锁定 05-保证金付款解锁
     */
    @Column(name = "LOCK_SOURCE")
    private String lockSource;

    /**
     * 缴清标识 00-未缴清 01-已缴清 02-需返还
     */
    @Column(name = "PAYMENT_FLAG")
    private String paymentFlag;

    /**
     * 乐观锁版本号
     */
    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    private int version;

    /**
     * 创建时间
     */
    @Column(name = "CREATED_TS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdTs;

    /**
     * 记录最后修改时间
     */
    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdTs;

    /**
     * 备注1
     */
    @Column(name = "REMARK1", length = 200)
    private String remark1;

    /**
     * 备注2
     */
    @Column(name = "REMARK2", length = 200)
    private String remark2;

    public long getSq() {
        return sq;
    }

    public void setSq(long sq) {
        this.sq = sq;
    }

    public Date getApplyTime() {
        return applyTime;
    }

    public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }

    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    public String getGnstAcct() {
        return gnstAcct;
    }

    public void setGnstAcct(String gnstAcct) {
        this.gnstAcct = gnstAcct;
    }

    public String getDepositAcct() {
        return depositAcct;
    }

    public void setDepositAcct(String depositAcct) {
        this.depositAcct = depositAcct;
    }

    public String getDepositFlag() {
        return depositFlag;
    }

    public void setDepositFlag(String depositFlag) {
        this.depositFlag = depositFlag;
    }

    public BigDecimal getPendingAmt() {
        return pendingAmt;
    }

    public void setPendingAmt(BigDecimal pendingAmt) {
        this.pendingAmt = pendingAmt;
    }

    public BigDecimal getAlreadyAmt() {
        return alreadyAmt;
    }

    public void setAlreadyAmt(BigDecimal alreadyAmt) {
        this.alreadyAmt = alreadyAmt;
    }

    public String getLockSource() {
        return lockSource;
    }

    public void setLockSource(String lockSource) {
        this.lockSource = lockSource;
    }

    public String getPaymentFlag() {
        return paymentFlag;
    }

    public void setPaymentFlag(String paymentFlag) {
        this.paymentFlag = paymentFlag;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    public String getRemark1() {
        return remark1;
    }

    public void setRemark1(String remark1) {
        this.remark1 = remark1;
    }

    public String getRemark2() {
        return remark2;
    }

    public void setRemark2(String remark2) {
        this.remark2 = remark2;
    }

    @Override
    public String toString() {
        return "CorpDepositInfo{" +
                "sq=" + sq +
                ", applyTime=" + applyTime +
                ", custId='" + custId + '\'' +
                ", gnstAcct='" + gnstAcct + '\'' +
                ", depositAcct='" + depositAcct + '\'' +
                ", depositFlag='" + depositFlag + '\'' +
                ", pendingAmt=" + pendingAmt +
                ", alreadyAmt=" + alreadyAmt +
                ", lockSource='" + lockSource + '\'' +
                ", paymentFlag='" + paymentFlag + '\'' +
                ", version=" + version +
                ", createdTs=" + createdTs +
                ", lastUpdTs=" + lastUpdTs +
                ", remark1='" + remark1 + '\'' +
                ", remark2='" + remark2 + '\'' +
                '}';
    }
}
